#!coding=utf-8
import time
from concurrent.futures import ThreadPoolExecutor, as_completed
from print_s import print_safe as print

def action(second):
    time.sleep(second)
    return second


lists = [2, 3, 4, 5]
all_task = []
with ThreadPoolExecutor(max_workers=2) as pool:
    for second in lists:
        all_task.append(pool.submit(action, second))

    for future in as_completed(all_task):
        print(f"{future.result()} 返回")

    print("----complete-----")
